package com.example.serviceb;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

import static org.springframework.http.ResponseEntity.ok;

/**
 * @author wangbin
 */
@SpringBootApplication
@RestController
public class ServicebApplication {
    @GetMapping("/")
    public ResponseEntity index() {
        return ok("this is service b");
    }

    @GetMapping("/test1")
    public ResponseEntity test1(){
        Map<String, Object> map = new HashMap<>(1);
        map.put("data", "this is service b test1 method");
        return ok(map);
    }

    @GetMapping("/test2")
    public ResponseEntity test2(){
        Map<String, Object> map = new HashMap<>(1);
        map.put("data", "this is service b test2 method");
        return ok(map);
    }

    public static void main(String[] args) {
        SpringApplication.run(ServicebApplication.class, args);
    }
}
